package com.qy.vo;

import com.qy.entity.Student;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author 袁大毛
 * * @date 2024/10/12 下午2:35
 * @描述
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {
    //状态码
    private Integer code;
    //提示信息
    private String msg;
    //数据
    private Object data;

    public R(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    //返回成功
    public static R ok(){
        return new R(200,"success",null);
    }
    //返回数据
    public static R ok(Object data){
        return new R(200,"success",data);
    }
    public static R ok(Integer code,String msg,Object data){
        return new R(code,msg,data);
    }
    //返回失败
    public static R error(String msg){
        return new R(500,msg);
    }

}